#include "GetCSB.h"
#include "Arduino.h"

GetCSB::GetCSB(int fsp, int jsp)
{
    this->FsPin = fsp;
    this->JsPin = jsp;
}

float GetCSB::GetPos()
{
    digitalWrite(FsPin, LOW);
    delayMicroseconds(2);
    digitalWrite(FsPin, HIGH);
    delayMicroseconds(15);
    digitalWrite(FsPin, LOW);

    return pulseIn(JsPin, HIGH) * 0.01715;
}